﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace FormattingLib
{






    /// <summary>
    /// 
    /// Samples1:
    ///   -3        -2        -1         0         1         2
    ///    +--|------+---------+----|----+--|------+----|--|-+
    ///       a                     b       c           d  e
    ///
    ///                        a=-2.7  b=-0.5  c=0.3  d=1.5  e=2.8
    /// =====================  ======  ======  =====  =====  =====
    /// Floor                    -3      -1      0      1      2
    /// Ceiling                  -2       0      1      2      3
    /// Truncate                 -2       0      0      1      2
    /// Round (ToEven)           -3       0      0      2      3
    /// Round (AwayFromZero)     -3      -1      0      2      3
    /// 
    /// Samples2:
    /// n = 3.145;
    /// a = System.Math.Round (n, 2, MidpointRounding.ToEven);       // 3.14
    /// b = System.Math.Round (n, 2, MidpointRounding.AwayFromZero); // 3.15
    /// 
    /// Samples3:
    /// Round(1.5) = 2
    /// Round(2.5) = 2
    /// Round(1.5, MidpointRounding.AwayFromZero) = 2
    /// Round(2.5, MidpointRounding.AwayFromZero) = 3
    /// Round(1.55, 1) = 1.6
    /// Round(1.65, 1) = 1.6
    /// Round(1.55, 1, MidpointRounding.AwayFromZero) = 1.6
    /// Round(1.65, 1, MidpointRounding.AwayFromZero) = 1.7
    /// 
    /// </summary>
    public enum RoundingType
    {
        None,
        Floor,
        Ceiling,
        Round
    }

}
